package com.mindainfo.groundwave.common.api.equipment.param;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.util.Date;

/**
 * Created by Administrator on 2017/8/10.
 */
public class RelayParam {

    @Data
    public static class QueryListParam{
        @NotNull(message = "start不能为空")
        @Min(value = 0,message = "start最小为0")
        private Integer start;

        @NotNull(message = "num不能为空")
        @Range(min = 1,max = 100,message = "num取值为1-100")
        private Integer num;
        private String key;
    }

    @Data
    public static class AddParam{
        @NotNull(message = "deviceId不能为空")
        @Length(min = 1,max = 50,message = "deviceId长度必须为1-50")
        private String deviceId;        //设备出厂编号

        @NotNull(message = "vendor不能为空")
        @Length(min = 1,max = 50,message = "vendor长度必须为1-50")
        private String vendor;          //厂商

        @NotNull(message = "version不能为空")
        @Length(min = 1,max = 50,message = "version长度必须为1-50")
        private String version;         //版本

        @NotNull(message = "makerTime不能为空")
        @Past(message = "makerTime只能为过去的一个时间")
        private Date makerTime;         //出厂时间

        @NotNull(message = "sysNum不能为空")
        @Length(min = 2,max = 20,message = "sysNum长度为2-20")
        private String sysNum;          //系统编号
    }

    @Data
    public static class ModifyParam{
        @NotNull(message = "deviceId不能为空")
        @Length(min = 1,max = 50,message = "deviceId长度必须为1-50")
        private String deviceId;        //设备出厂编号

        @NotNull(message = "vendor不能为空")
        @Length(min = 1,max = 50,message = "vendor长度必须为1-50")
        private String vendor;          //厂商

        @NotNull(message = "version不能为空")
        @Length(min = 1,max = 50,message = "version长度必须为1-50")
        private String version;         //版本

        @NotNull(message = "makerTime不能为空")
        @Past(message = "makerTime只能为过去的一个时间")
        private Date makerTime;         //出厂时间

        @NotNull(message = "sysNum不能为空")
        @Length(min = 2,max = 20,message = "sysNum长度为2-20")
        private String sysNum;          //系统编号
    }

    @Data
    public static class InstallParam{
        @NotNull(message = "persionName不能为空")
        @Length(min = 2,max = 20,message = "persionName长度为2-20")
        private String persionName;     //安装人员

        @NotNull(message = "installTime不能为空")
        @Past(message = "installTime只能为过去的一个时间")
        private Date installTime;       //安装时间

        @NotNull(message = "location不能为空")
        @Length(min = 2,max = 100,message = "location长度为2-100")
        private String location;        //位置

        @NotNull(message = "lng不能为空")
        private Double lng;             //经度

        @NotNull(message = "lat不能为空")
        private Double lat;             //纬度

        @NotNull(message = "sysNum不能为空")
        private String sysNum;          //设备的系统编号
    }
}
